Skip to content

[ImageCopy] fix image copy failure when resource group location and disk location differ#2284

Merged
arrownj merged 1 commit intoAzure:masterfrom
arrownj:image_copy_fix
Sep 3, 2020
Merged

[ImageCopy] fix image copy failure when resource group location and disk location differ#2284
arrownj merged 1 commit intoAzure:masterfrom
arrownj:image_copy_fix

Conversation

@arrownj
Copy link
Contributor

@arrownj arrownj commented Sep 2, 2020

In create_snapshot function, there is a line

location = location or _get_resource_group_location(cmd.cli_ctx, resource_group_name)

However service will use this location to retrieve the disk information. If the disk location differs with resource group location, service will throw "Resource disk_xxxxxxxx not found" error.

This makes the az image copy command fails.

This is a workaround solution from image-copy side for this case. The snapshot issue az image copy failed create snapshot is recorded in azure-cli repo.


This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally?

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your PR is merged into master branch, a new PR will be created to update src/index.json automatically.
The precondition is to put your code inside this repo and upgrade the version in the PR but do not modify src/index.json.

@azuresdkci
Copy link

If this PR is for a new extension or change to an existing extension, use the following to try out the changes in this PR:

docker run -it microsoft/azure-cli:latest
export EXT=<NAME>
pip install --upgrade --target ~/.azure/cliextensions/$EXT "git+https://github.com/arrownj/azure-cli-extensions.git@image_copy_fix#subdirectory=src/$EXT&egg=$EXT"

@arrownj arrownj requested review from qwordy and yungezz September 2, 2020 09:16
@arrownj arrownj self-assigned this Sep 2, 2020
@arrownj arrownj requested a review from houk-ms September 2, 2020 09:18
@qwordy
Copy link
Member

qwordy commented Sep 2, 2020

Have asked raman from storage to confirm this behavior

@qwordy
Copy link
Member

qwordy commented Sep 2, 2020

Maybe you need to add a test to approve that it solves the issue.

@yungezz yungezz added the Compute label Sep 2, 2020
@arrownj arrownj merged commit b789f0d into Azure:master Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants